perm filename PAGE2[E,ALS] blob sn#181952 filedate 1975-10-17 generic text, type C, neo UTF8
COMMENT ⊗   VALID 00002 PAGES
C REC  PAGE   DESCRIPTION
C00001 00001
C00002 00002	E -- DISPLAY EDITOR FOR STANFORD
C00014 ENDMK
C⊗;
;E -- DISPLAY EDITOR FOR STANFORD
;Written by Frederick H.G. Wright II 
;with modifications by D. Poole, Art Samuel, and Stan Kugell.
;The Essay program was contracted by John Mccarthy and written by Stan Kugell

PRINTS /Type 0 to get ETV, 1 to get ESSAY, then <CTRL><META><LF>./
ESSFLG←←.INSER TTY:

IFE ESSFLG<TITLE ETV -- DISPLAY EDITOR FOR STANFORD↔SUBTTL FREDERICK H.G. WRIGHT II
PRINTS /       You are assembling ETV, the Stanford Display Editor
/
PRINTS⊗	July 6  E.49(p545)	July 17 E.50(P551)	July 25 E.51(P512)
	July 27 E.52(P554)	July 30 E.53(P554)	July 31 E.54(T16)
	Aug. 2  E.55(P558)	Aug. 5	E.56(P558)	Aug.11	E.57(P560)
	Aug 14	E.58(T27)	Aug.18	E.59(P567)	Aug. 20 E.60(P567)
		E.61(P570)	Sept.17	E.62(P575)	Sept.23	E.63(p581)
	Sep.30	E.64(p581)	OCT. 9	E.65(P584)	Oct.17	E,66
see E.52 and E.66 for details as to changes in earlier versions
Note that E.52 and all that follow use and requires new PTL7W9 on system 7.01 T.
 If backing up to system before this one must use E.51.
E.59 ME fixes to CRLF'S and to improve operations on TTY's
see E.59 for changes from E.52 through E.59
E.60 fixed bug causing \ and * commands to start search from wrong column.
E.61 ALLACT mode used: type-ahead for line-editor wins; BS now works like VT.
 XSNKOFF,XSNKON,XNWFILE flushed.  αβ<form> means αβ-<form>.  0W, 0L do half window.
E.62 ∂ command for handling messages.  Improvement in positioning line after a
 search.  ACs A,B preserved for dispatch routine by FOUND.  File switching after
 R E;<file> startup doesn't cause TMPCOR file to be written out.
E.63 0∃ bug fixed.  αβFaaaαβ\bbb<cr> made illegal in attach mode.
 RENAME to update time/date written is no longer done by E (system does it).
 ++++ changed to .... at edge of window.
 ε and λ fixed to not close current file if illegal file number given.
E.64 Fix to SETJMP to avoid glitching screen just because BOTWIN is -1.
 Debugged additions to LINCNT and to TELLME code by ALS.
 Fixed substitution bug that caused list of lines to be clobbered.
 XBURP command to burp null records from a single page.
E.65 XDEFINE and Y macro- defining and calling commands.
 αV now just redraws screen.  αβV erases screen then redraws.
 DETACHing and then ATTACHing an E job now works a little better.
E.66 BUG in JUST with periods at the end of a line fixed.(UP on Oct. 9)
 Fixed LOADMT and EDIT to not do PTLOAD for IMLACs or other non-displays.
 Fixed FRD not to call EPSIL4 if no name given when coming from XRUN or XRSYS.
 Flushed references to PTL assembly switch (used PTLOAD instead of PTL7W9 if PTL=0).
 Fixed character count bug in CENTER and INDENT.
 Total page count on bottom line now shows ? with an incomplete directory.
 X and B values now appear on the trailing line.
⊗>

IFN ESSFLG<TITLE ESSAY
PRINTS /       You are assembling Essay.
/>
DEFINE ESSAY <IFN ESSFLG>
DEFINE NOESS <IFE ESSFLG>

COMMENT ⊗ TO PUT UP A NEW E WITH AN UPPER SEGMENT, USE THE COMMANDS:

.LOA %SE%1<%2V%1B	;LOADS WITH SYMBOLS AND NNRAID IN THE UPPER SEGMENT
.S 137			;RENAMES UPPER, WRITE PROTECTS AND SETS ITS PROTECTION CONSTANT
.SSAVE SYS E		;BE SURE TO SSave (to keep the UPPER SEGMENT around)

DATA STRUCTURE.
	A page  of text is  represented in memory  as a theaded  list of
items  each representing a  single line of  the text. Each  item in this
representation contains four  words of header  information, the text  of
the line in question and one trailer word.
	The first header word contains a TXTCOD, which for ordinary text
is a 2 in the left half and the total number of words in the right half. 
This word  is used by the free storage  management routines. It does not
seem to be used by the text manipulation sections of the code.  The word
count is duplicated in  the trailer word which is also  used only by the
free storage routines. 
	The  second  header  word is  a  pointer word.    It  contains a
backward pointer  in  the left  half  pointing to  the location  of  the
pointer  word of  the previous  item  and in  the right  half  a forward
pointer to  the location  of the  pointer  word of  the next  item.  The
location of the pointer word for the first item is contained in the word
at  PAGE and  the  backward pointer  for the  first item points  back to
PAGE. The last item on the page points to the word BOTSTR and  this word
points back to this last item and forward to itself.  When in the ATTACH
mode,   the  location  ATTBUF points  to the pointer  word of  the first
attached line and back to the pointer word of the last attached line.
	The third word contains  flag bits in the left  half identifying
the type  of the line and two  9-bit bytes in the right  half. Flag bits
which have been identified are:
	400000	 the line is a page mark.
	200000	 the line is ARRLIN (CURRENT to which the arrow points).
	100000	 the line is WINLIN (the first line on the window).
	040000   the line is an Essay reference (for the ESSAY version).
The  first byte  in  the right  half  contains the  total  count of  the
characters as the line is stored on the disk, where a TAB symbol counts
1 and the terminating CR and LF are counted.
The  second byte  contains  the  count of  the  characters as  they  are
displayed where a TAB is counted as the number of spaces it produces and
the terminating CR and LF are not counted. 

	The fourth word is the serial number of the line as kept in the
core. This number is changed every time that a change is made to the line
so this number then bears no relationship to the position of the line on
the page.

	The text occupies an integral number of words and is  padded out
with nulls.
	The trailer  word contains the count  of the total words  in the
item,   including  header   and  trailer  words.   This  duplicates  the
information in the right half of the first header word.

       TABs are handled in a pecular way. When a TAB occurs it is stored
as  a TAB and  this is  followed by as  many spaces  as the TAB  in fact
produces in the text and then by a terminating TAB.

       end of comment ⊗

NOLIT

;Register	Most common usage

F←0		;Flag bits
A←1		;Argument value
B←2		;CONTROL and META bits as stripped from command character.
C←3		;Character
D←4		;Dispatch table entry
E←5		;Table location.
G←6
H←7
I←10
DSP←11		;Dispatch table location (CTAB most of the time).
Q←14
T←15
TT←16
P←17		;Always reserved as PDL pointer.

DEFINE STOPJ
	{PUSHJ P,STOPJC	
	}	
;Used to replace JRST 4,. and other fatal halts to inform ALS of trouble
;STOPJ USED FOR JRST 4,. terminating with a JRST 4,. as usual
;STOPC used for JRST 4,. WHEN ATTEMPT IS MADE TO CONTINUE

IFNDEF PURESW<PURESW←←1>	;DEFAULT TO SHARABLE PURE UPPER SEGMENT
IFNDEF DEBSW<DEBSW←←1>
IFNDEF BOOKMD<BOOKMD←←1>
;BOOKMD NON-ZERO PERMITS /B MODE FOR READING BOOKS.  0 DISABLES /B MODE.

COPNUM←←3	;LOG OF # K OF CORE FOR TEMP COPY BUFFER
SRSIZ←←40	;SIZE OF SEARCH STRING BUFFER
LPDL←←69
DPYBSZ←←=660*2

DSKI←←1
DSKO←←2
DSKSP←←4	;Used for spooling file
DSKCH←←5	;Used to write into bug file TELLME.001[E,ALS] , .002 etc.
SWP←←3
IFN BOOKMD, {
RPGO←←4		;CHANNEL USED TO WRITE OUT .BKP FILE IN BKPSW MODE
};END BOOKMD

...←←0

;Type of display (kept in cell called DPY)
$TTY ←← 0	;Teletype kludge
$DD  ←←	1	;Datadisk video type display
$III ←←	2	;III Vector type display
IFNDEF MACDWP<MACDWP←←0>	;Disable DWP's macro-implementing code.